package com.tyron.builder.compiling;

import com.android.annotations.NonNull;
import com.tyron.builder.internal.incremental.DependencyData;
import com.android.ide.common.process.ProcessOutputHandler;
import java.io.File;
import java.io.IOException;
import java.util.Collection;
import java.util.List;

/**
 * A Class that processes a dependency file after a compilation.
 *
 * <p>During compilation of aidl, it is possible to provide an instance of
 * DependencyFileProcessor to process the dependency files generated by the compilers.
 *
 * <p>It can be useful to store the dependency in a better format than a per-file dependency file.
 *
 * <p>The instance will be called for each dependency file that is created during compilation.
 *
 */
public interface DependencyFileProcessor {

    DependencyFileProcessor NO_OP = (File dependencyFile) -> null;

    /**
     * Processes the dependency file.
     * @param dependencyFile the dependency file.
     * @return the dependency data that was created.
     */
    DependencyData processFile(@NonNull File dependencyFile) throws IOException;
}